home *** CD-ROM | disk | FTP | other *** search
- {@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
- The purchaser of these procedures and functions may include them in COMPILED
- programs freely, but may not sell or give away the source text.
-
- This function checks for the existence of a file of the name passed to it
- by attempting to reset the file with I/O error checking switched off, and
- then looking at IOResult, the built-in variable that holds I/O error
- messages. This function will NOT check for files in any but the current
- directory--use the "Find_First" function in GETFILE.LIB for those.
-
- function EXISTS: boolean;
- input : a filename of a TYPE declared in user program (BEFORE including this
- file!)
- output: true if exists else false.
-
- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
-
- function exists(ThisFile : old_filename_Type):boolean;
- var
- tempFile : text; {We can get away with assigning a text file to ANY
- filename because we aren't going to do any input/output}
- begin
- assign(tempFile,ThisFile);
- {$I-}
- reset(tempFile);
- {$I+}
- if IOResult = 0 then exists := true
- else exists := false;
- close(tempFile);
- end;